<template>
  <input :value="name" @input="handleName" />
  <input :value="age" @input="handleAge" />
</template>
<script setup>
import { defineProps, defineEmits } from "vue";
const props = defineProps(["name", "age"]);
const emit = defineEmits(["update:name", "update:age"]);
//在模板中是可以直接使用属性对象上的属性的
console.log("props", props);
const handleName = ($event) => {
  emit("update:name", $event.target.value);
};
const handleAge = ($event) => {
  emit("update:age", $event.target.value);
};
</script>
